package Happy;

import java.util.ArrayList;
import java.util.Scanner;

public class Fruit {
	private String name;

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String toString() {
		return super.toString();
	}
	public boolean equal(String str){
		return this.name.equalsIgnoreCase(str);
	}
	public static void main(String[] args){
		Fruit fruit1=new Fruit();
		Fruit fruit2=new Fruit();
		fruit1.setName("pear");
		fruit2.setName("PEAR");
		System.out.println(fruit1.equal(fruit2.name));
		ArrayList<Fruit> fruitList=new ArrayList();
	    Scanner s=new Scanner(System.in);
	    Fruit h=new Fruit();
	    while(s.hasNext()){
	    	h.setName(s.nextLine());
		    if(fruitList.contains(h)){
		    	continue;
		    }
		    fruitList.add(h);

		}
	}
}


